home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / info / texinfo.info-7.z / texinfo.info-7
Encoding:
GNU Info File  |  1998-05-21  |  49.4 KB  |  1,377 lines

  1. This is Info file ../info/texinfo.info, produced by Makeinfo version
  2. 1.68 from the input file texinfo.texi.
  3.  
  4. INFO-DIR-SECTION Texinfo documentation system
  5. START-INFO-DIR-ENTRY
  6. * Texinfo: (texinfo).           The GNU documentation format.
  7. * install-info: (texinfo)Invoking install-info. Updating info/dir entries.
  8. * texi2dvi: (texinfo)Format with texi2dvi.      Printing Texinfo documentation.
  9. * texindex: (texinfo)Format with tex/texindex.  Sorting Texinfo index files.
  10. * makeinfo: (texinfo)makeinfo Preferred.        Translate Texinfo source.
  11. END-INFO-DIR-ENTRY
  12.  
  13.   This file documents Texinfo, a documentation system that can produce
  14. both on-line information and a printed manual from a single source file.
  15.  
  16.   Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97 Free Software
  17. Foundation, Inc.
  18.  
  19.   This is the second edition of the Texinfo documentation,
  20. and is consistent with version 2 of `texinfo.tex'.
  21.  
  22.   Permission is granted to make and distribute verbatim copies of this
  23. manual provided the copyright notice and this permission notice are
  24. preserved on all copies.
  25.  
  26.   Permission is granted to copy and distribute modified versions of this
  27. manual under the conditions for verbatim copying, provided that the
  28. entire resulting derived work is distributed under the terms of a
  29. permission notice identical to this one.
  30.  
  31.   Permission is granted to copy and distribute translations of this
  32. manual into another language, under the above conditions for modified
  33. versions, except that this permission notice may be stated in a
  34. translation approved by the Free Software Foundation.
  35.  
  36. 
  37. File: texinfo.info,  Node: group,  Next: need,  Prev: page,  Up: Breaks
  38.  
  39. `@group': Prevent Page Breaks
  40. =============================
  41.  
  42.   The `@group' command (on a line by itself) is used inside an
  43. `@example' or similar construct to begin an unsplittable vertical
  44. group, which will appear entirely on one page in the printed output.
  45. The group is terminated by a line containing only `@end group'.  These
  46. two lines produce no output of their own, and in the Info file output
  47. they have no effect at all.
  48.  
  49.   Although `@group' would make sense conceptually in a wide variety of
  50. contexts, its current implementation works reliably only within
  51. `@example' and variants, and within `@display', `@format', `@flushleft'
  52. and `@flushright'.  *Note Quotations and Examples::.  (What all these
  53. commands have in common is that each line of input produces a line of
  54. output.)  In other contexts, `@group' can cause anomalous vertical
  55. spacing.
  56.  
  57.   This formatting requirement means that you should write:
  58.  
  59.      @example
  60.      @group
  61.      ...
  62.      @end group
  63.      @end example
  64.  
  65. with the `@group' and `@end group' commands inside the `@example' and
  66. `@end example' commands.
  67.  
  68.   The `@group' command is most often used to hold an example together
  69. on one page.  In this Texinfo manual, more than 100 examples contain
  70. text that is enclosed between `@group' and `@end group'.
  71.  
  72.   If you forget to end a group, you may get strange and unfathomable
  73. error messages when you run TeX.  This is because TeX keeps trying to
  74. put the rest of the Texinfo file onto the one page and does not start
  75. to generate error messages until it has processed considerable text.
  76. It is a good rule of thumb to look for a missing `@end group' if you
  77. get incomprehensible error messages in TeX.
  78.  
  79. 
  80. File: texinfo.info,  Node: need,  Prev: group,  Up: Breaks
  81.  
  82. `@need MILS': Prevent Page Breaks
  83. =================================
  84.  
  85.   A line containing only `@need N' starts a new page in a printed
  86. manual if fewer than N mils (thousandths of an inch) remain on the
  87. current page.  Do not use braces around the argument N.  The `@need'
  88. command has no effect on Info files since they are not paginated.
  89.  
  90.   This paragraph is preceded by an `@need' command that tells TeX to
  91. start a new page if fewer than 800 mils (eight-tenths inch) remain on
  92. the page.  It looks like this:
  93.  
  94.      @need 800
  95.      This paragraph is preceded by ...
  96.  
  97.   The `@need' command is useful for preventing orphans (single lines at
  98. the bottoms of printed pages).
  99.  
  100. 
  101. File: texinfo.info,  Node: Definition Commands,  Next: Footnotes,  Prev: Breaks,  Up: Top
  102.  
  103. Definition Commands
  104. *******************
  105.  
  106.   The `@deffn' command and the other "definition commands" enable you
  107. to describe functions, variables, macros, commands, user options,
  108. special forms and other such artifacts in a uniform format.
  109.  
  110.   In the Info file, a definition causes the entity
  111. category--`Function', `Variable', or whatever--to appear at the
  112. beginning of the first line of the definition, followed by the entity's
  113. name and arguments.  In the printed manual, the command causes TeX to
  114. print the entity's name and its arguments on the left margin and print
  115. the category next to the right margin.  In both output formats, the
  116. body of the definition is indented.  Also, the name of the entity is
  117. entered into the appropriate index: `@deffn' enters the name into the
  118. index of functions, `@defvr' enters it into the index of variables, and
  119. so on.
  120.  
  121.   A manual need not and should not contain more than one definition for
  122. a given name.  An appendix containing a summary should use `@table'
  123. rather than the definition commands.
  124.  
  125. * Menu:
  126.  
  127. * Def Cmd Template::            How to structure a description using a
  128.                                   definition command.
  129. * Optional Arguments::          How to handle optional and repeated arguments.
  130. * deffnx::                      How to group two or more `first' lines.
  131. * Def Cmds in Detail::          All the definition commands.
  132. * Def Cmd Conventions::         Conventions for writing definitions.
  133. * Sample Function Definition::
  134.  
  135. 
  136. File: texinfo.info,  Node: Def Cmd Template,  Next: Optional Arguments,  Prev: Definition Commands,  Up: Definition Commands
  137.  
  138. The Template for a Definition
  139. =============================
  140.  
  141.   The `@deffn' command is used for definitions of entities that
  142. resemble functions.  To write a definition using the `@deffn' command,
  143. write the `@deffn' command at the beginning of a line and follow it on
  144. the same line by the category of the entity, the name of the entity
  145. itself, and its arguments (if any).  Then write the body of the
  146. definition on succeeding lines.  (You may embed examples in the body.)
  147. Finally, end the definition with an `@end deffn' command written on a
  148. line of its own.  (The other definition commands follow the same
  149. format.)
  150.  
  151.   The template for a definition looks like this:
  152.  
  153.      @deffn CATEGORY NAME ARGUMENTS...
  154.      BODY-OF-DEFINITION
  155.      @end deffn
  156.  
  157. For example,
  158.  
  159.      @deffn Command forward-word count
  160.      This command moves point forward @var{count} words
  161.      (or backward if @var{count} is negative). ...
  162.      @end deffn
  163.  
  164. produces
  165.  
  166.       - Command: forward-word COUNT
  167.           This function moves point forward COUNT words (or backward if
  168.           COUNT is negative). ...
  169.  
  170.   Capitalize the category name like a title.  If the name of the
  171. category contains spaces, as in the phrase `Interactive Command', write
  172. braces around it.  For example:
  173.  
  174.      @deffn {Interactive Command} isearch-forward
  175.      ...
  176.      @end deffn
  177.  
  178. Otherwise, the second word will be mistaken for the name of the entity.
  179.  
  180.   Some of the definition commands are more general than others.  The
  181. `@deffn' command, for example, is the general definition command for
  182. functions and the like--for entities that may take arguments.  When you
  183. use this command, you specify the category to which the entity belongs.
  184. The `@deffn' command possesses three predefined, specialized
  185. variations, `@defun', `@defmac', and `@defspec', that specify the
  186. category for you: "Function", "Macro", and "Special Form" respectively.
  187. (In Lisp, a special form is an entity much like a function.)  The
  188. `@defvr' command also is accompanied by several predefined, specialized
  189. variations for describing particular kinds of variables.
  190.  
  191.   The template for a specialized definition, such as `@defun', is
  192. similar to the template for a generalized definition, except that you
  193. do not need to specify the category:
  194.  
  195.      @defun NAME ARGUMENTS...
  196.      BODY-OF-DEFINITION
  197.      @end defun
  198.  
  199. Thus,
  200.  
  201.      @defun buffer-end flag
  202.      This function returns @code{(point-min)} if @var{flag}
  203.      is less than 1, @code{(point-max)} otherwise.
  204.      ...
  205.      @end defun
  206.  
  207. produces
  208.  
  209.       - Function: buffer-end FLAG
  210.           This function returns `(point-min)' if FLAG is less than 1,
  211.           `(point-max)' otherwise.  ...
  212.  
  213. *Note Sample Function Definition: Sample Function Definition, for a
  214. more detailed example of a function definition, including the use of
  215. `@example' inside the definition.
  216.  
  217.   The other specialized commands work like `@defun'.
  218.  
  219. 
  220. File: texinfo.info,  Node: Optional Arguments,  Next: deffnx,  Prev: Def Cmd Template,  Up: Definition Commands
  221.  
  222. Optional and Repeated Arguments
  223. ===============================
  224.  
  225.   Some entities take optional or repeated arguments, which may be
  226. specified by a distinctive glyph that uses square brackets and
  227. ellipses.  For example, a special form often breaks its argument list
  228. into separate arguments in more complicated ways than a straightforward
  229. function.
  230.  
  231.   An argument enclosed within square brackets is optional.  Thus,
  232. [OPTIONAL-ARG] means that OPTIONAL-ARG is optional.  An argument
  233. followed by an ellipsis is optional and may be repeated more than once.
  234. Thus, REPEATED-ARGS... stands for zero or more arguments.  Parentheses
  235. are used when several arguments are grouped into additional levels of
  236. list structure in Lisp.
  237.  
  238.   Here is the `@defspec' line of an example of an imaginary special
  239. form:
  240.  
  241.       - Special Form: foobar (VAR [FROM TO [INC]]) BODY...
  242.  
  243. In this example, the arguments FROM and TO are optional, but must both
  244. be present or both absent.  If they are present, INC may optionally be
  245. specified as well.  These arguments are grouped with the argument VAR
  246. into a list, to distinguish them from BODY, which includes all
  247. remaining elements of the form.
  248.  
  249.   In a Texinfo source file, this `@defspec' line is written like this
  250. (except it would not be split over two lines, as it is in this example).
  251.  
  252.      @defspec foobar (@var{var} [@var{from} @var{to}
  253.           [@var{inc}]]) @var{body}@dots{}
  254.  
  255. The function is listed in the Command and Variable Index under `foobar'.
  256.  
  257. 
  258. File: texinfo.info,  Node: deffnx,  Next: Def Cmds in Detail,  Prev: Optional Arguments,  Up: Definition Commands
  259.  
  260. Two or More `First' Lines
  261. =========================
  262.  
  263.   To create two or more `first' or header lines for a definition, follow
  264. the first `@deffn' line by a line beginning with `@deffnx'.  The
  265. `@deffnx' command works exactly like `@deffn' except that it does not
  266. generate extra vertical white space between it and the preceding line.
  267.  
  268.   For example,
  269.  
  270.      @deffn {Interactive Command} isearch-forward
  271.      @deffnx {Interactive Command} isearch-backward
  272.      These two search commands are similar except ...
  273.      @end deffn
  274.  
  275. produces
  276.  
  277.  - Interactive Command: isearch-forward
  278.  - Interactive Command: isearch-backward
  279.      These two search commands are similar except ...
  280.  
  281.   Each of the other definition commands has an `x' form: `@defunx',
  282. `@defvrx', `@deftypefunx', etc.
  283.  
  284.   The `x' forms work just like `@itemx'; see *Note `@itemx': itemx.
  285.  
  286. 
  287. File: texinfo.info,  Node: Def Cmds in Detail,  Next: Def Cmd Conventions,  Prev: deffnx,  Up: Definition Commands
  288.  
  289. The Definition Commands
  290. =======================
  291.  
  292.   Texinfo provides more than a dozen definition commands, all of which
  293. are described in this section.
  294.  
  295.   The definition commands automatically enter the name of the entity in
  296. the appropriate index: for example, `@deffn', `@defun', and `@defmac'
  297. enter function names in the index of functions; `@defvr' and `@defvar'
  298. enter variable names in the index of variables.
  299.  
  300.   Although the examples that follow mostly illustrate Lisp, the commands
  301. can be used for other programming languages.
  302.  
  303. * Menu:
  304.  
  305. * Functions Commands::          Commands for functions and similar entities.
  306. * Variables Commands::          Commands for variables and similar entities.
  307. * Typed Functions::             Commands for functions in typed languages.
  308. * Typed Variables::             Commands for variables in typed languages.
  309. * Abstract Objects::            Commands for object-oriented programming.
  310. * Data Types::                  The definition command for data types.
  311.  
  312. 
  313. File: texinfo.info,  Node: Functions Commands,  Next: Variables Commands,  Prev: Def Cmds in Detail,  Up: Def Cmds in Detail
  314.  
  315. Functions and Similar Entities
  316. ------------------------------
  317.  
  318.   This section describes the commands for describing functions and
  319. similar entities:
  320.  
  321. `@deffn CATEGORY NAME ARGUMENTS...'
  322.      The `@deffn' command is the general definition command for
  323.      functions, interactive commands, and similar entities that may take
  324.      arguments.  You must choose a term to describe the category of
  325.      entity being defined; for example, "Function" could be used if the
  326.      entity is a function.  The `@deffn' command is written at the
  327.      beginning of a line and is followed on the same line by the
  328.      category of entity being described, the name of this particular
  329.      entity, and its arguments, if any.  Terminate the definition with
  330.      `@end deffn' on a line of its own.
  331.  
  332.      For example, here is a definition:
  333.  
  334.           @deffn Command forward-char nchars
  335.           Move point forward @var{nchars} characters.
  336.           @end deffn
  337.  
  338.      This shows a rather terse definition for a "command" named
  339.      `forward-char' with one argument, NCHARS.
  340.  
  341.      `@deffn' prints argument names such as NCHARS in italics or upper
  342.      case, as if `@var' had been used, because we think of these names
  343.      as metasyntactic variables--they stand for the actual argument
  344.      values.  Within the text of the description, write an argument name
  345.      explicitly with `@var' to refer to the value of the argument.  In
  346.      the example above, we used `@var{nchars}' in this way.
  347.  
  348.      The template for `@deffn' is:
  349.  
  350.           @deffn CATEGORY NAME ARGUMENTS...
  351.           BODY-OF-DEFINITION
  352.           @end deffn
  353.  
  354. `@defun NAME ARGUMENTS...'
  355.      The `@defun' command is the definition command for functions.
  356.      `@defun' is equivalent to `@deffn Function ...'.
  357.  
  358.      For example,
  359.  
  360.           @defun set symbol new-value
  361.           Change the value of the symbol @var{symbol}
  362.           to @var{new-value}.
  363.           @end defun
  364.  
  365.      shows a rather terse definition for a function `set' whose
  366.      arguments are SYMBOL and NEW-VALUE.  The argument names on the
  367.      `@defun' line automatically appear in italics or upper case as if
  368.      they were enclosed in `@var'.  Terminate the definition with `@end
  369.      defun' on a line of its own.
  370.  
  371.      The template is:
  372.  
  373.           @defun FUNCTION-NAME ARGUMENTS...
  374.           BODY-OF-DEFINITION
  375.           @end defun
  376.  
  377.      `@defun' creates an entry in the index of functions.
  378.  
  379. `@defmac NAME ARGUMENTS...'
  380.      The `@defmac' command is the definition command for macros.
  381.      `@defmac' is equivalent to `@deffn Macro ...' and works like
  382.      `@defun'.
  383.  
  384. `@defspec NAME ARGUMENTS...'
  385.      The `@defspec' command is the definition command for special
  386.      forms.  (In Lisp, a special form is an entity much like a function,
  387.      *note Special Forms: (elisp)Special Forms..)  `@defspec' is
  388.      equivalent to `@deffn {Special Form} ...' and works like `@defun'.
  389.  
  390. 
  391. File: texinfo.info,  Node: Variables Commands,  Next: Typed Functions,  Prev: Functions Commands,  Up: Def Cmds in Detail
  392.  
  393. Variables and Similar Entities
  394. ------------------------------
  395.  
  396.   Here are the commands for defining variables and similar entities:
  397.  
  398. `@defvr CATEGORY NAME'
  399.      The `@defvr' command is a general definition command for something
  400.      like a variable--an entity that records a value.  You must choose
  401.      a term to describe the category of entity being defined; for
  402.      example, "Variable" could be used if the entity is a variable.
  403.      Write the `@defvr' command at the beginning of a line and followed
  404.      it on the same line by the category of the entity and the name of
  405.      the entity.
  406.  
  407.      Capitalize the category name like a title.  If the name of the
  408.      category contains spaces, as in the name "User Option", enclose it
  409.      in braces.  Otherwise, the second word will be mistaken for the
  410.      name of the entity.  For example,
  411.  
  412.           @defvr {User Option} fill-column
  413.           This buffer-local variable specifies
  414.           the maximum width of filled lines.
  415.           ...
  416.           @end defvr
  417.  
  418.      Terminate the definition with `@end defvr' on a line of its own.
  419.  
  420.      The template is:
  421.  
  422.           @defvr CATEGORY NAME
  423.           BODY-OF-DEFINITION
  424.           @end defvr
  425.  
  426.      `@defvr' creates an entry in the index of variables for NAME.
  427.  
  428. `@defvar NAME'
  429.      The `@defvar' command is the definition command for variables.
  430.      `@defvar' is equivalent to `@defvr Variable ...'.
  431.  
  432.      For example:
  433.  
  434.           @defvar kill-ring
  435.           ...
  436.           @end defvar
  437.  
  438.      The template is:
  439.  
  440.           @defvar NAME
  441.           BODY-OF-DEFINITION
  442.           @end defvar
  443.  
  444.      `@defvar' creates an entry in the index of variables for NAME.
  445.  
  446. `@defopt NAME'
  447.      The `@defopt' command is the definition command for "user
  448.      options", i.e., variables intended for users to change according to
  449.      taste; Emacs has many such (*note Variables: (emacs)Variables.).
  450.      `@defopt' is equivalent to `@defvr {User Option} ...' and works
  451.      like `@defvar'.
  452.  
  453. 
  454. File: texinfo.info,  Node: Typed Functions,  Next: Typed Variables,  Prev: Variables Commands,  Up: Def Cmds in Detail
  455.  
  456. Functions in Typed Languages
  457. ----------------------------
  458.  
  459.   The `@deftypefn' command and its variations are for describing
  460. functions in languages in which you must declare types of variables and
  461. functions, such as C and C++.
  462.  
  463. `@deftypefn CATEGORY DATA-TYPE NAME ARGUMENTS...'
  464.      The `@deftypefn' command is the general definition command for
  465.      functions and similar entities that may take arguments and that are
  466.      typed.  The `@deftypefn' command is written at the beginning of a
  467.      line and is followed on the same line by the category of entity
  468.      being described, the type of the returned value, the name of this
  469.      particular entity, and its arguments, if any.
  470.  
  471.      For example,
  472.  
  473.           @deftypefn {Library Function} int foobar
  474.              (int @var{foo}, float @var{bar})
  475.           ...
  476.           @end deftypefn
  477.  
  478.      (where the text before the "...", shown above as two lines, would
  479.      actually be a single line in a real Texinfo file) produces the
  480.      following in Info:
  481.  
  482.           -- Library Function: int foobar (int FOO, float BAR)
  483.           ...
  484.  
  485.      This means that `foobar' is a "library function" that returns an
  486.      `int', and its arguments are FOO (an `int') and BAR (a `float').
  487.  
  488.      The argument names that you write in `@deftypefn' are not subject
  489.      to an implicit `@var'--since the actual names of the arguments in
  490.      `@deftypefn' are typically scattered among data type names and
  491.      keywords, Texinfo cannot find them without help.  Instead, you
  492.      must write `@var' explicitly around the argument names.  In the
  493.      example above, the argument names are `foo' and `bar'.
  494.  
  495.      The template for `@deftypefn' is:
  496.  
  497.           @deftypefn CATEGORY DATA-TYPE NAME ARGUMENTS ...
  498.           BODY-OF-DESCRIPTION
  499.           @end deftypefn
  500.  
  501.      Note that if the CATEGORY or DATA TYPE is more than one word then
  502.      it must be enclosed in braces to make it a single argument.
  503.  
  504.      If you are describing a procedure in a language that has packages,
  505.      such as Ada, you might consider using `@deftypefn' in a manner
  506.      somewhat contrary to the convention described in the preceding
  507.      paragraphs.
  508.  
  509.      For example:
  510.  
  511.           @deftypefn stacks private push
  512.                   (@var{s}:in out stack;
  513.                   @var{n}:in integer)
  514.           ...
  515.           @end deftypefn
  516.  
  517.      (The `@deftypefn' arguments are shown split into three lines, but
  518.      would be a single line in a real Texinfo file.)
  519.  
  520.      In this instance, the procedure is classified as belonging to the
  521.      package `stacks' rather than classified as a `procedure' and its
  522.      data type is described as `private'.  (The name of the procedure
  523.      is `push', and its arguments are S and N.)
  524.  
  525.      `@deftypefn' creates an entry in the index of functions for NAME.
  526.  
  527. `@deftypefun DATA-TYPE NAME ARGUMENTS...'
  528.      The `@deftypefun' command is the specialized definition command
  529.      for functions in typed languages.  The command is equivalent to
  530.      `@deftypefn Function ...'.
  531.  
  532.      Thus,
  533.  
  534.           @deftypefun int foobar (int @var{foo}, float @var{bar})
  535.           ...
  536.           @end deftypefun
  537.  
  538.      produces the following in Info:
  539.  
  540.           -- Function: int foobar (int FOO, float BAR)
  541.           ...
  542.  
  543.      The template is:
  544.  
  545.           @deftypefun TYPE NAME ARGUMENTS...
  546.           BODY-OF-DESCRIPTION
  547.           @end deftypefun
  548.  
  549.      `@deftypefun' creates an entry in the index of functions for NAME.
  550.  
  551. `@deftypemethod CLASS DATA-TYPE METHOD-NAME ARGUMENTS...'
  552.      The `@deftypemethod' command is the definition command for methods
  553.      in object-oriented typed languages, such as C++ and Java.  It is
  554.      similar to the `@deftypefn' with the addition of the CLASS
  555.      parameter to specify the class containing the method.
  556.  
  557. 
  558. File: texinfo.info,  Node: Typed Variables,  Next: Abstract Objects,  Prev: Typed Functions,  Up: Def Cmds in Detail
  559.  
  560. Variables in Typed Languages
  561. ----------------------------
  562.  
  563.   Variables in typed languages are handled in a manner similar to
  564. functions in typed languages.  *Note Typed Functions::.  The general
  565. definition command `@deftypevr' corresponds to `@deftypefn' and the
  566. specialized definition command `@deftypevar' corresponds to
  567. `@deftypefun'.
  568.  
  569. `@deftypevr CATEGORY DATA-TYPE NAME'
  570.      The `@deftypevr' command is the general definition command for
  571.      something like a variable in a typed language--an entity that
  572.      records a value.  You must choose a term to describe the category
  573.      of the entity being defined; for example, "Variable" could be used
  574.      if the entity is a variable.
  575.  
  576.      The `@deftypevr' command is written at the beginning of a line and
  577.      is followed on the same line by the category of the entity being
  578.      described, the data type, and the name of this particular entity.
  579.  
  580.      For example:
  581.  
  582.           @deftypevr {Global Flag} int enable
  583.           ...
  584.           @end deftypevr
  585.  
  586.      produces the following in Info:
  587.  
  588.           -- Global Flag: int enable
  589.           ...
  590.  
  591.      The template is:
  592.  
  593.           @deftypevr CATEGORY DATA-TYPE NAME
  594.           BODY-OF-DESCRIPTION
  595.           @end deftypevr
  596.  
  597.      `@deftypevr' creates an entry in the index of variables for NAME.
  598.  
  599. `@deftypevar DATA-TYPE NAME'
  600.      The `@deftypevar' command is the specialized definition command
  601.      for variables in typed languages.  `@deftypevar' is equivalent to
  602.      `@deftypevr Variable ...'.
  603.  
  604.      For example:
  605.  
  606.           @deftypevar int fubar
  607.           ...
  608.           @end deftypevar
  609.  
  610.      produces the following in Info:
  611.  
  612.           -- Variable: int fubar
  613.           ...
  614.  
  615.      The template is:
  616.  
  617.           @deftypevar DATA-TYPE NAME
  618.           BODY-OF-DESCRIPTION
  619.           @end deftypevar
  620.  
  621.      `@deftypevar' creates an entry in the index of variables for NAME.
  622.  
  623. 
  624. File: texinfo.info,  Node: Abstract Objects,  Next: Data Types,  Prev: Typed Variables,  Up: Def Cmds in Detail
  625.  
  626. Object-Oriented Programming
  627. ---------------------------
  628.  
  629.   Here are the commands for formatting descriptions about abstract
  630. objects, such as are used in object-oriented programming.  A class is a
  631. defined type of abstract object.  An instance of a class is a
  632. particular object that has the type of the class.  An instance variable
  633. is a variable that belongs to the class but for which each instance has
  634. its own value.
  635.  
  636.   In a definition, if the name of a class is truly a name defined in the
  637. programming system for a class, then you should write an `@code' around
  638. it.  Otherwise, it is printed in the usual text font.
  639.  
  640. `@defcv CATEGORY CLASS NAME'
  641.      The `@defcv' command is the general definition command for
  642.      variables associated with classes in object-oriented programming.
  643.      The `@defcv' command is followed by three arguments: the category
  644.      of thing being defined, the class to which it belongs, and its
  645.      name.  Thus,
  646.  
  647.           @defcv {Class Option} Window border-pattern
  648.           ...
  649.           @end defcv
  650.  
  651.      illustrates how you would write the first line of a definition of
  652.      the `border-pattern' class option of the class `Window'.
  653.  
  654.      The template is
  655.  
  656.           @defcv CATEGORY CLASS NAME
  657.           ...
  658.           @end defcv
  659.  
  660.      `@defcv' creates an entry in the index of variables.
  661.  
  662. `@defivar CLASS NAME'
  663.      The `@defivar' command is the definition command for instance
  664.      variables in object-oriented programming.  `@defivar' is
  665.      equivalent to `@defcv {Instance Variable} ...'
  666.  
  667.      The template is:
  668.  
  669.           @defivar CLASS INSTANCE-VARIABLE-NAME
  670.           BODY-OF-DEFINITION
  671.           @end defivar
  672.  
  673.      `@defivar' creates an entry in the index of variables.
  674.  
  675. `@defop CATEGORY CLASS NAME ARGUMENTS...'
  676.      The `@defop' command is the general definition command for
  677.      entities that may resemble methods in object-oriented programming.
  678.      These entities take arguments, as functions do, but are associated
  679.      with particular classes of objects.
  680.  
  681.      For example, some systems have constructs called "wrappers" that
  682.      are associated with classes as methods are, but that act more like
  683.      macros than like functions.  You could use `@defop Wrapper' to
  684.      describe one of these.
  685.  
  686.      Sometimes it is useful to distinguish methods and "operations".
  687.      You can think of an operation as the specification for a method.
  688.      Thus, a window system might specify that all window classes have a
  689.      method named `expose'; we would say that this window system
  690.      defines an `expose' operation on windows in general.  Typically,
  691.      the operation has a name and also specifies the pattern of
  692.      arguments; all methods that implement the operation must accept
  693.      the same arguments, since applications that use the operation do
  694.      so without knowing which method will implement it.
  695.  
  696.      Often it makes more sense to document operations than methods.  For
  697.      example, window application developers need to know about the
  698.      `expose' operation, but need not be concerned with whether a given
  699.      class of windows has its own method to implement this operation.
  700.      To describe this operation, you would write:
  701.  
  702.           @defop Operation windows expose
  703.  
  704.      The `@defop' command is written at the beginning of a line and is
  705.      followed on the same line by the overall name of the category of
  706.      operation, the name of the class of the operation, the name of the
  707.      operation, and its arguments, if any.
  708.  
  709.      The template is:
  710.  
  711.           @defop CATEGORY CLASS NAME ARGUMENTS...
  712.           BODY-OF-DEFINITION
  713.           @end defop
  714.  
  715.      `@defop' creates an entry, such as ``expose' on `windows'', in the
  716.      index of functions.
  717.  
  718. `@defmethod CLASS NAME ARGUMENTS...'
  719.      The `@defmethod' command is the definition command for methods in
  720.      object-oriented programming.  A method is a kind of function that
  721.      implements an operation for a particular class of objects and its
  722.      subclasses.  In the Lisp Machine, methods actually were functions,
  723.      but they were usually defined with `defmethod'.
  724.  
  725.      `@defmethod' is equivalent to `@defop Method ...'.  The command is
  726.      written at the beginning of a line and is followed by the name of
  727.      the class of the method, the name of the method, and its
  728.      arguments, if any.
  729.  
  730.      For example,
  731.  
  732.           @defmethod `bar-class' bar-method argument
  733.           ...
  734.           @end defmethod
  735.  
  736.      illustrates the definition for a method called `bar-method' of the
  737.      class `bar-class'.  The method takes an argument.
  738.  
  739.      The template is:
  740.  
  741.           @defmethod CLASS METHOD-NAME ARGUMENTS...
  742.           BODY-OF-DEFINITION
  743.           @end defmethod
  744.  
  745.      `@defmethod' creates an entry, such as ``bar-method' on
  746.      `bar-class'', in the index of functions.
  747.  
  748. `@deftypemethod CLASS DATA-TYPE NAME ARGUMENTS...'
  749.      The `@deftypemethod' command is the definition command for methods
  750.      in object-oriented typed languages, such as C++ and Java.  It is
  751.      similar to the `@defmethod' command with the addition of the
  752.      DATA-TYPE parameter to specify the return type of the method.
  753.  
  754. 
  755. File: texinfo.info,  Node: Data Types,  Prev: Abstract Objects,  Up: Def Cmds in Detail
  756.  
  757. Data Types
  758. ----------
  759.  
  760.   Here is the command for data types:
  761.  
  762. `@deftp CATEGORY NAME ATTRIBUTES...'
  763.      The `@deftp' command is the generic definition command for data
  764.      types.  The command is written at the beginning of a line and is
  765.      followed on the same line by the category, by the name of the type
  766.      (which is a word like `int' or `float'), and then by names of
  767.      attributes of objects of that type.  Thus, you could use this
  768.      command for describing `int' or `float', in which case you could
  769.      use `data type' as the category.  (A data type is a category of
  770.      certain objects for purposes of deciding which operations can be
  771.      performed on them.)
  772.  
  773.      In Lisp, for example,  "pair" names a particular data type, and an
  774.      object of that type has two slots called the CAR and the CDR.
  775.      Here is how you would write the first line of a definition of
  776.      `pair'.
  777.  
  778.           @deftp {Data type} pair car cdr
  779.           ...
  780.           @end deftp
  781.  
  782.      The template is:
  783.  
  784.           @deftp CATEGORY NAME-OF-TYPE ATTRIBUTES...
  785.           BODY-OF-DEFINITION
  786.           @end deftp
  787.  
  788.      `@deftp' creates an entry in the index of data types.
  789.  
  790. 
  791. File: texinfo.info,  Node: Def Cmd Conventions,  Next: Sample Function Definition,  Prev: Def Cmds in Detail,  Up: Definition Commands
  792.  
  793. Conventions for Writing Definitions
  794. ===================================
  795.  
  796.   When you write a definition using `@deffn', `@defun', or one of the
  797. other definition commands, please take care to use arguments that
  798. indicate the meaning, as with the COUNT argument to the `forward-word'
  799. function.  Also, if the name of an argument contains the name of a
  800. type, such as INTEGER, take care that the argument actually is of that
  801. type.
  802.  
  803. 
  804. File: texinfo.info,  Node: Sample Function Definition,  Prev: Def Cmd Conventions,  Up: Definition Commands
  805.  
  806. A Sample Function Definition
  807. ============================
  808.  
  809.   A function definition uses the `@defun' and `@end defun' commands.
  810. The name of the function follows immediately after the `@defun' command
  811. and it is followed, on the same line, by the parameter list.
  812.  
  813.   Here is a definition from *Note Calling Functions: (elisp)Calling
  814. Functions.
  815.  
  816.       - Function: apply FUNCTION &rest ARGUMENTS
  817.           `apply' calls FUNCTION with ARGUMENTS, just like `funcall'
  818.           but with one difference: the last of ARGUMENTS is a list of
  819.           arguments to give to FUNCTION, rather than a single argument.
  820.           We also say that this list is "appended" to the other
  821.           arguments.
  822.  
  823.           `apply' returns the result of calling FUNCTION.  As with
  824.           `funcall', FUNCTION must either be a Lisp function or a
  825.           primitive function; special forms and macros do not make
  826.           sense in `apply'.
  827.  
  828.                (setq f 'list)
  829.                     => list
  830.                (apply f 'x 'y 'z)
  831.                error--> Wrong type argument: listp, z
  832.                (apply '+ 1 2 '(3 4))
  833.                     => 10
  834.                (apply '+ '(1 2 3 4))
  835.                     => 10
  836.                
  837.                (apply 'append '((a b c) nil (x y z) nil))
  838.                     => (a b c x y z)
  839.  
  840.           An interesting example of using `apply' is found in the
  841.           description of `mapcar'.
  842.  
  843.   In the Texinfo source file, this example looks like this:
  844.  
  845.      @defun apply function &rest arguments
  846.      
  847.      @code{apply} calls @var{function} with
  848.      @var{arguments}, just like @code{funcall} but with one
  849.      difference: the last of @var{arguments} is a list of
  850.      arguments to give to @var{function}, rather than a single
  851.      argument.  We also say that this list is @dfn{appended}
  852.      to the other arguments.
  853.      
  854.      @code{apply} returns the result of calling
  855.      @var{function}.  As with @code{funcall},
  856.      @var{function} must either be a Lisp function or a
  857.      primitive function; special forms and macros do not make
  858.      sense in @code{apply}.
  859.      
  860.      @example
  861.      (setq f 'list)
  862.           @result{} list
  863.      (apply f 'x 'y 'z)
  864.      @error{} Wrong type argument: listp, z
  865.      (apply '+ 1 2 '(3 4))
  866.           @result{} 10
  867.      (apply '+ '(1 2 3 4))
  868.           @result{} 10
  869.      
  870.      (apply 'append '((a b c) nil (x y z) nil))
  871.           @result{} (a b c x y z)
  872.      @end example
  873.      
  874.      An interesting example of using @code{apply} is found
  875.      in the description of @code{mapcar}.@refill
  876.      @end defun
  877.  
  878. In this manual, this function is listed in the Command and Variable
  879. Index under `apply'.
  880.  
  881.   Ordinary variables and user options are described using a format like
  882. that for functions except that variables do not take arguments.
  883.  
  884. 
  885. File: texinfo.info,  Node: Footnotes,  Next: Conditionals,  Prev: Definition Commands,  Up: Top
  886.  
  887. Footnotes
  888. *********
  889.  
  890.   A "footnote" is for a reference that documents or elucidates the
  891. primary text.(1) (*note Footnotes-Footnotes::)
  892.  
  893. * Menu:
  894.  
  895. * Footnote Commands::           How to write a footnote in Texinfo.
  896. * Footnote Styles::             Controlling how footnotes appear in Info.
  897.  
  898. 
  899. File: texinfo.info,  Node: Footnotes-Footnotes,  Up: Footnotes
  900.  
  901.   (1) A footnote should complement or expand upon the primary text, but
  902. a reader should not need to read a footnote to understand the primary
  903. text.  For a thorough discussion of footnotes, see `The Chicago Manual
  904. of Style', which is published by the University of Chicago Press.
  905.  
  906. 
  907. File: texinfo.info,  Node: Footnote Commands,  Next: Footnote Styles,  Prev: Footnotes,  Up: Footnotes
  908.  
  909. Footnote Commands
  910. =================
  911.  
  912.   In Texinfo, footnotes are created with the `@footnote' command.  This
  913. command is followed immediately by a left brace, then by the text of
  914. the footnote, and then by a terminating right brace.  Footnotes may be
  915. of any length (they will be broken across pages if necessary), but are
  916. usually short.  The template is:
  917.  
  918.      ordinary text@footnote{TEXT OF FOOTNOTE}
  919.  
  920.   As shown here, the `@footnote' command should come right after the
  921. text being footnoted, with no intervening space; otherwise, the
  922. formatters the footnote mark might end up starting up a line.
  923.  
  924.   For example, this clause is followed by a sample footnote(1) (*note
  925. Footnote Commands-Footnotes::); in the Texinfo source, it looks like
  926. this:
  927.  
  928.      ...a sample footnote@footnote{Here is the sample
  929.      footnote.}; in the Texinfo source...
  930.  
  931.   *Warning:* Don't use footnotes in the argument of the `@item' command
  932. for a `@table' table.  This doesn't work, and because of limitations of
  933. TeX, there is no way to fix it.  You must put the footnote into the
  934. body text of the table.
  935.  
  936.   In a printed manual or book, the reference mark for a footnote is a
  937. small, superscripted number; the text of the footnote appears at the
  938. bottom of the page, below a horizontal line.
  939.  
  940.   In Info, the reference mark for a footnote is a pair of parentheses
  941. with the footnote number between them, like this: `(1)'.
  942.  
  943. 
  944. File: texinfo.info,  Node: Footnote Commands-Footnotes,  Up: Footnote Commands
  945.  
  946.   (1) Here is the sample footnote.
  947.  
  948. 
  949. File: texinfo.info,  Node: Footnote Styles,  Prev: Footnote Commands,  Up: Footnotes
  950.  
  951. Footnote Styles
  952. ===============
  953.  
  954.   Info has two footnote styles, which determine where the text of the
  955. footnote is located:
  956.  
  957.    * In the `End' node style, all the footnotes for a single node are
  958.      placed at the end of that node.  The footnotes are separated from
  959.      the rest of the node by a line of dashes with the word `Footnotes'
  960.      within it.  Each footnote begins with an `(N)' reference mark.
  961.  
  962.      Here is an example of a single footnote in the end of node style:
  963.  
  964.            --------- Footnotes ---------
  965.           
  966.           (1)  Here is a sample footnote.
  967.  
  968.    * In the `Separate' node style, all the footnotes for a single node
  969.      are placed in an automatically constructed node of their own.  In
  970.      this style, a "footnote reference" follows each `(N)' reference
  971.      mark in the body of the node.  The footnote reference is actually
  972.      a cross reference which you use to reach the footnote node.
  973.  
  974.      The name of the node containing the footnotes is constructed by
  975.      appending `-Footnotes' to the name of the node that contains the
  976.      footnotes. (Consequently, the footnotes' node for the `Footnotes'
  977.      node is `Footnotes-Footnotes'!)  The footnotes' node has an `Up'
  978.      node pointer that leads back to its parent node.
  979.  
  980.      Here is how the first footnote in this manual looks after being
  981.      formatted for Info in the separate node style:
  982.  
  983.           File: texinfo.info  Node: Overview-Footnotes, Up: Overview
  984.           
  985.           (1) Note that the first syllable of "Texinfo" is
  986.           pronounced like "speck", not "hex". ...
  987.  
  988.   A Texinfo file may be formatted into an Info file with either footnote
  989. style.
  990.  
  991.   Use the `@footnotestyle' command to specify an Info file's footnote
  992. style.  Write this command at the beginning of a line followed by an
  993. argument, either `end' for the end node style or `separate' for the
  994. separate node style.
  995.  
  996.   For example,
  997.  
  998.      @footnotestyle end
  999.  
  1000. or
  1001.      @footnotestyle separate
  1002.  
  1003.   Write an `@footnotestyle' command before or shortly after the
  1004. end-of-header line at the beginning of a Texinfo file.  (If you include
  1005. the `@footnotestyle' command between the start-of-header and
  1006. end-of-header lines, the region formatting commands will format
  1007. footnotes as specified.)
  1008.  
  1009.   If you do not specify a footnote style, the formatting commands use
  1010. their default style.  Currently, `texinfo-format-buffer' and
  1011. `texinfo-format-region' use the `separate' style and `makeinfo' uses
  1012. the `end' style.
  1013.  
  1014.   This chapter contains two footnotes.
  1015.  
  1016. 
  1017. File: texinfo.info,  Node: Conditionals,  Next: Macros,  Prev: Footnotes,  Up: Top
  1018.  
  1019. Conditionally Visible Text
  1020. **************************
  1021.  
  1022.   Sometimes it is good to use different text for a printed manual and
  1023. its corresponding Info file.  In this case, you can use the
  1024. "conditional commands" to specify which text is for the printed manual
  1025. and which is for the Info file.
  1026.  
  1027. * Menu:
  1028.  
  1029. * Conditional Commands::        Specifying text for HTML, Info, or TeX.
  1030. * Conditional Not Commands::    Specifying text for not HTML, Info, or TeX.
  1031. * Raw Formatter Commands::      Using raw TeX or HTML commands.
  1032. * set clear value::             Designating which text to format (for
  1033.                                   all output formats); and how to set a
  1034.                                   flag to a string that you can insert.
  1035.  
  1036. 
  1037. File: texinfo.info,  Node: Conditional Commands,  Next: Conditional Not Commands,  Prev: Conditionals,  Up: Conditionals
  1038.  
  1039. Conditional Commands
  1040. ====================
  1041.  
  1042.   `@ifinfo' begins segments of text that should be ignored by TeX when
  1043. it typesets the printed manual.  The segment of text appears only in
  1044. the Info file.  The `@ifinfo' command should appear on a line by
  1045. itself;  end the Info-only text with a line containing `@end ifinfo' by
  1046. itself.  At the beginning of a Texinfo file, the Info permissions are
  1047. contained within a region marked by `@ifinfo' and `@end ifinfo'. (*Note
  1048. Info Summary and Permissions::.)
  1049.  
  1050.   The `@iftex' and `@end iftex' commands are similar to the `@ifinfo'
  1051. and `@end ifinfo' commands, except that they specify text that will
  1052. appear in the printed manual but not in the Info file.  Likewise for
  1053. `@ifhtml' and `@end ifhtml', which specify text to appear only in HTML
  1054. output.
  1055.  
  1056.   For example,
  1057.  
  1058.      @iftex
  1059.      This text will appear only in the printed manual.
  1060.      @end iftex
  1061.      @ifinfo
  1062.      However, this text will appear only in Info.
  1063.      @end ifinfo
  1064.  
  1065. The preceding example produces the following line: However, this text
  1066. will appear only in Info.
  1067.  
  1068. Note how you only see one of the two lines, depending on whether you
  1069. are reading the Info version or the printed version of this manual.
  1070.  
  1071.   The `@titlepage' command is a special variant of `@iftex' that is
  1072. used for making the title and copyright pages of the printed manual.
  1073. (*Note `@titlepage': titlepage.)
  1074.  
  1075. 
  1076. File: texinfo.info,  Node: Conditional Not Commands,  Next: Raw Formatter Commands,  Prev: Conditional Commands,  Up: Conditionals
  1077.  
  1078. Conditional Not Commands
  1079. ========================
  1080.  
  1081.   You can specify text to be included in any output format *other* than
  1082. some given one with the `@ifnot...' commands:
  1083.      @ifnothtml ... @end ifnothtml
  1084.      @ifnotinfo ... @end ifnotinfo
  1085.      @ifnottex ... @end ifnottex
  1086.  
  1087. (The `@ifnot...' command and the `@end' command must actually appear on
  1088. lines by themselves.)
  1089.  
  1090.   If the output file is not being made for the given format, the region
  1091. is included.  Otherwise, it is ignored.
  1092.  
  1093.   The regions delimited by these commands are ordinary Texinfo source as
  1094. with `@iftex', not raw formatter source as with `@tex'.
  1095.  
  1096. 
  1097. File: texinfo.info,  Node: Raw Formatter Commands,  Next: set clear value,  Prev: Conditional Not Commands,  Up: Conditionals
  1098.  
  1099. Raw Formatter Commands
  1100. ======================
  1101.  
  1102.   Inside a region delineated by `@iftex' and `@end iftex', you can
  1103. embed some raw TeX commands.  Info will ignore these commands since
  1104. they are only in that part of the file which is seen by TeX.  You can
  1105. write the TeX commands as you would write them in a normal TeX file,
  1106. except that you must replace the `\' used by TeX with an `@'.  For
  1107. example, in the `@titlepage' section of a Texinfo file, you can use the
  1108. TeX command `@vskip' to format the copyright page.  (The `@titlepage'
  1109. command causes Info to ignore the region automatically, as it does with
  1110. the `@iftex' command.)
  1111.  
  1112.   However, many features of plain TeX will not work, as they are
  1113. overridden by Texinfo features.
  1114.  
  1115.   You can enter plain TeX completely, and use `\' in the TeX commands,
  1116. by delineating a region with the `@tex' and `@end tex' commands.  (The
  1117. `@tex' command also causes Info to ignore the region, like the `@iftex'
  1118. command.)  The sole exception is that `@' chracter still introduces a
  1119. command, so that `@end tex' can be recognized properly.
  1120.  
  1121.   For example, here is a mathematical expression written in plain TeX:
  1122.  
  1123.      @tex
  1124.      $$ \chi^2 = \sum_{i=1}^N
  1125.                \left (y_i - (a + b x_i)
  1126.                \over \sigma_i\right)^2 $$
  1127.      @end tex
  1128.  
  1129. The output of this example will appear only in a printed manual.  If
  1130. you are reading this in Info, you will not see the equation that appears
  1131. in the printed manual.
  1132.  
  1133.   Analogously, you can use `@ifhtml ... @end ifhtml' to delimit a
  1134. region to be included in HTML output only, and `@html ...  @end ifhtml'
  1135. for a region of raw HTML (again, except that `@' is still the escape
  1136. character, so the `@end' command can be recognized.)
  1137.  
  1138. 
  1139. File: texinfo.info,  Node: set clear value,  Prev: Raw Formatter Commands,  Up: Conditionals
  1140.  
  1141. `@set', `@clear', and `@value'
  1142. ==============================
  1143.  
  1144.   You can direct the Texinfo formatting commands to format or ignore
  1145. parts of a Texinfo file with the `@set', `@clear', `@ifset', and
  1146. `@ifclear' commands.
  1147.  
  1148.   In addition, you can use the `@set FLAG' command to set the value of
  1149. FLAG to a string of characters; and use `@value{FLAG}' to insert that
  1150. string.  You can use `@set', for example, to set a date and use
  1151. `@value' to insert the date in several places in the Texinfo file.
  1152.  
  1153. * Menu:
  1154.  
  1155. * ifset ifclear::               Format a region if a flag is set.
  1156. * value::                       Replace a flag with a string.
  1157. * value Example::               An easy way to update edition information.
  1158.  
  1159. 
  1160. File: texinfo.info,  Node: ifset ifclear,  Next: value,  Prev: set clear value,  Up: set clear value
  1161.  
  1162. `@ifset' and `@ifclear'
  1163. -----------------------
  1164.  
  1165.   When a FLAG is set, the Texinfo formatting commands format text
  1166. between subsequent pairs of `@ifset FLAG' and `@end ifset' commands.
  1167. When the FLAG is cleared, the Texinfo formatting commands do *not*
  1168. format the text.
  1169.  
  1170.   Use the `@set FLAG' command to turn on, or "set", a FLAG; a "flag"
  1171. can be any single word.  The format for the command looks like this:
  1172.  
  1173.      @set FLAG
  1174.  
  1175.   Write the conditionally formatted text between `@ifset FLAG' and
  1176. `@end ifset' commands, like this:
  1177.  
  1178.      @ifset FLAG
  1179.      CONDITIONAL-TEXT
  1180.      @end ifset
  1181.  
  1182.   For example, you can create one document that has two variants, such
  1183. as a manual for a `large' and `small' model:
  1184.  
  1185.      You can use this machine to dig up shrubs
  1186.      without hurting them.
  1187.      
  1188.      @set large
  1189.      
  1190.      @ifset large
  1191.      It can also dig up fully grown trees.
  1192.      @end ifset
  1193.      
  1194.      Remember to replant promptly ...
  1195.  
  1196. In the example, the formatting commands will format the text between
  1197. `@ifset large' and `@end ifset' because the `large' flag is set.
  1198.  
  1199.   Use the `@clear FLAG' command to turn off, or "clear", a flag.
  1200. Clearing a flag is the opposite of setting a flag.  The command looks
  1201. like this:
  1202.  
  1203.      @clear FLAG
  1204.  
  1205. Write the command on a line of its own.
  1206.  
  1207.   When FLAG is cleared, the Texinfo formatting commands do *not* format
  1208. the text between `@ifset FLAG' and `@end ifset'; that text is ignored
  1209. and does not appear in either printed or Info output.
  1210.  
  1211.   For example, if you clear the flag of the preceding example by writing
  1212. an `@clear large' command after the `@set large' command (but before
  1213. the conditional text), then the Texinfo formatting commands ignore the
  1214. text between the `@ifset large' and `@end ifset' commands.  In the
  1215. formatted output, that text does not appear; in both printed and Info
  1216. output, you see only the lines that say, "You can use this machine to
  1217. dig up shrubs without hurting them.  Remember to replant promptly ...".
  1218.  
  1219.   If a flag is cleared with an `@clear FLAG' command, then the
  1220. formatting commands format text between subsequent pairs of `@ifclear'
  1221. and `@end ifclear' commands.  But if the flag is set with `@set FLAG',
  1222. then the formatting commands do *not* format text between an `@ifclear'
  1223. and an `@end ifclear' command; rather, they ignore that text.  An
  1224. `@ifclear' command looks like this:
  1225.  
  1226.      @ifclear FLAG
  1227.  
  1228.   In brief, the commands are:
  1229.  
  1230. `@set FLAG'
  1231.      Tell the Texinfo formatting commands that FLAG is set.
  1232.  
  1233. `@clear FLAG'
  1234.      Tell the Texinfo formatting commands that FLAG is cleared.
  1235.  
  1236. `@ifset FLAG'
  1237.      If FLAG is set, tell the Texinfo formatting commands to format the
  1238.      text up to the following `@end ifset' command.
  1239.  
  1240.      If FLAG is cleared, tell the Texinfo formatting commands to ignore
  1241.      text up to the following `@end ifset' command.
  1242.  
  1243. `@ifclear FLAG'
  1244.      If FLAG is set, tell the Texinfo formatting commands to ignore the
  1245.      text up to the following `@end ifclear' command.
  1246.  
  1247.      If FLAG is cleared, tell the Texinfo formatting commands to format
  1248.      the text up to the following `@end ifclear' command.
  1249.  
  1250. 
  1251. File: texinfo.info,  Node: value,  Next: value Example,  Prev: ifset ifclear,  Up: set clear value
  1252.  
  1253. `@value'
  1254. --------
  1255.  
  1256.   You can use the `@set' command to specify a value for a flag, which
  1257. is expanded by the `@value' command.  The value is a string a
  1258. characters.
  1259.  
  1260.   Write the `@set' command like this:
  1261.  
  1262.      @set foo This is a string.
  1263.  
  1264. This sets the value of `foo' to "This is a string."
  1265.  
  1266.   The Texinfo formatters replace an `@value{FLAG}' command with the
  1267. string to which FLAG is set.
  1268.  
  1269.   Thus, when `foo' is set as shown above, the Texinfo formatters convert
  1270.  
  1271.      @value{foo}
  1272. to
  1273.      This is a string.
  1274.  
  1275.   You can write an `@value' command within a paragraph; but you must
  1276. write an `@set' command on a line of its own.
  1277.  
  1278.   If you write the `@set' command like this:
  1279.  
  1280.      @set foo
  1281.  
  1282. without specifying a string, the value of `foo' is an empty string.
  1283.  
  1284.   If you clear a previously set flag with an `@clear FLAG' command, a
  1285. subsequent `@value{flag}' command is invalid and the string is replaced
  1286. with an error message that says `{No value for "FLAG"}'.
  1287.  
  1288.   For example, if you set `foo' as follows:
  1289.  
  1290.      @set how-much very, very, very
  1291.  
  1292. then the formatters transform
  1293.  
  1294.      It is a @value{how-much} wet day.
  1295. into
  1296.      It is a very, very, very wet day.
  1297.  
  1298.   If you write
  1299.  
  1300.      @clear how-much
  1301.  
  1302. then the formatters transform
  1303.  
  1304.      It is a @value{how-much} wet day.
  1305. into
  1306.      It is a {No value for "how-much"} wet day.
  1307.  
  1308. 
  1309. File: texinfo.info,  Node: value Example,  Prev: value,  Up: set clear value
  1310.  
  1311. `@value' Example
  1312. ----------------
  1313.  
  1314.   You can use the `@value' command to limit the number of places you
  1315. need to change when you record an update to a manual.  Here is how it
  1316. is done in `The GNU Make Manual':
  1317.  
  1318. Set the flags:
  1319.  
  1320.      @set EDITION 0.35 Beta
  1321.      @set VERSION 3.63 Beta
  1322.      @set UPDATED 14 August 1992
  1323.      @set UPDATE-MONTH August 1992
  1324.  
  1325. Write text for the first `@ifinfo' section, for people reading the
  1326. Texinfo file:
  1327.  
  1328.      This is Edition @value{EDITION},
  1329.      last updated @value{UPDATED},
  1330.      of @cite{The GNU Make Manual},
  1331.      for @code{make}, Version @value{VERSION}.
  1332.  
  1333. Write text for the title page, for people reading the printed manual:
  1334.  
  1335.      @title GNU Make
  1336.      @subtitle A Program for Directing Recompilation
  1337.      @subtitle Edition @value{EDITION}, ...
  1338.      @subtitle @value{UPDATE-MONTH}
  1339.  
  1340. (On a printed cover, a date listing the month and the year looks less
  1341. fussy than a date listing the day as well as the month and year.)
  1342.  
  1343. Write text for the Top node, for people reading the Info file:
  1344.  
  1345.      This is Edition @value{EDITION}
  1346.      of the @cite{GNU Make Manual},
  1347.      last updated @value{UPDATED}
  1348.      for @code{make} Version @value{VERSION}.
  1349.  
  1350.   After you format the manual, the text in the first `@ifinfo' section
  1351. looks like this:
  1352.  
  1353.      This is Edition 0.35 Beta, last updated 14 August 1992,
  1354.      of `The GNU Make Manual', for `make', Version 3.63 Beta.
  1355.  
  1356.   When you update the manual, change only the values of the flags; you
  1357. do not need to rewrite the three sections.
  1358.  
  1359. 
  1360. File: texinfo.info,  Node: Macros,  Next: Format/Print Hardcopy,  Prev: Conditionals,  Up: Top
  1361.  
  1362. Macros: Defining New Texinfo Commands
  1363. *************************************
  1364.  
  1365.   A Texinfo "macro" allows you to define a new Texinfo command as any
  1366. sequence of text and/or existing commands (including other macros).  The
  1367. macro can have any number of "parameters"--text you supply each time
  1368. you use the macro.  (This has nothing to do with the `@defmac' command,
  1369. which is for documenting macros in the subject of the manual; *note Def
  1370. Cmd Template::..)
  1371.  
  1372. * Menu:
  1373.  
  1374. * Defining Macros::             Both defining and undefining new commands.
  1375. * Invoking Macros::             Using a macro, once you've defined it.
  1376.  
  1377.